'It's been good talking to you — I'm going to go and get a drink' is a complete exit. Warm honest lines for the situations you actually struggle with, plus the two seconds of body language that do most of the work.
It's more visible than you'd think, it feels bad to do, and it has to be maintained — you now can't be seen enjoying yourself for the next twenty minutes. Honest and warm is genuinely easier.
The exit starts with your body — a small step back, a shift in stance, a hand on the table. Say it while you're already moving, or the sentence has nowhere to go.
'Well, I should probably...' gives them somewhere to reply into, and now you're another twenty minutes in. Finishing the sentence is most of the skill.
Which is worse for the relationship than leaving warmly ten minutes earlier. The person talking to you has no idea, and would almost certainly rather you'd gone.