From personal experience I've found stress to be very destructive to any kind of sex life. A few years ago I was going through a very bad time, which lasted for about 5 years. My OH and I probably had sex about five or six times a year, which was torture for both of us, but I just wasn't in the mood.
Fortunately my OH was incredibly understanding and understood the reasons. Talk to your OH and explain how you feel, and that you don't know why you do.
I'm not as horny as I was in my teens, it's just part of life. My understanding is that men's sex drive reduces around middle age, while women are hitting their peak. Stupid bloody biology!
If it's been going on for a while, it won't do any harm to see a doctor. You'd certainly not be the first middle age man they will have seen in the career - or even that day.