I didn't get into a really comfortable place in my head or heart until I was in my forties. Part of it was getting a decent psychiatrist, and part of it was developing some perspective and figuring out what was actually possible.
No advice, really, just an observation. Forty isn't the end, but it is a good time to reevaluate.