I think it is purely a mental problem. I have been there not able to get an erection but still wanted to reach a climax, it can happen from over exertion and draining your sex drive. But it can be a lot more than that as well. Sometimes it can be as simple as not having your true fantasies going through your head. Question... If you get really close with a girl and you may not go all the way, later on when you are alone would it be a quick time well spent session?
I think most guys have had a similar problem at times in one sense or another. My solution would be to commit to a time in your day to masturbate once (like at night) I bet you would find your sex drive will improve drastically, and your timing will get back to what it was. And after a long day of seeing hot college birds walking around or the hot one in your group work, you will have the drive of a Lamborghini laredo. It takes discipline and trial and error. The fact is masturbation can be very addictive like gambling, the trick is to be careful and make sure at the end of the month you have your rent in your bank account. (Analogy) rent meaning sperm