Well that's something you're going to need to confront, because it will happen at some point. Any relationship more than a few years old is going to have stretches of crap sex. Maybe because you're not getting on about something, maybe because you've had kids and you're just completely knackered. Maybe because he's fighting a crush on someone at work, or maybe because you are. Maybe it's not him who feels that you're boring and unsexy, maybe you start feeling it about yourself.
Relationships aren't always good, nothing that lasts that long is. They have ebbs and flows, and the way you feel about both yourself and your partner at various points in your life is going to change, and the way you feel about sex with them will change alongside it.
Sex isn't always about "You're utterly irresistible and I must rip your clothes off right now". Sometimes sex is just about wanting to feel close to your partner, sometimes it's about making up after an argument, sometimes it's just about wanting to get off, and sometimes it's literally just because there's fuck all on TV.
And so yes, for most people, their minds will drift sometimes during sex. Not always, not frequently, but sometimes. And sometimes it'll drift to loading the dishwasher, or paying for the kids school trip. And sometimes it'll drift to Scarlett Johansen, or Chris Hemsworth, or that person in the office you're flighting a crush on. And you'll never know, because your not a mind reader, and because that kind of sex where you're laser focused on how hot your partner is just isn't an "always" thing in a long term relationship.