Interrupt yourself! Try this. First, gain control of the conversation. Then in the middle of a sentence, abruptly stop talking, glance at your watch, and mention the time in an urgent manner. For example: “Oh! It’s three-fifty! I need to get going.” That’s all it takes.
Notice the technique. It’s honest and not threatening because it’s never rude to interrupt yourself. Plus, it puts you in control. It breaks the conversation politely so you can be on your way.