I'm 41 and I went through the same thing a couple of years back. I think it's a result of seeing so many apparently perfect, but actually air-brushed or cosmetically enhanced celebrities all the time. It's something no normal person can hope to live up to.
It is a shock to suddenly realise we don't look young any more, but what really matters is what kind of person you are. Anyone who's worth knowing likes you for you, not the way you look.
That said, there's nothing wrong with trying to look your best -as other have suggested, try a good moisturiser, have your hair cut in a different style, buy some new clothes. It can help you feel more positive about yourself.
What eventually snapped me out of it was pretty drastic. Three friends a similar age to me have been diagnosed with cancer over the past few years -two have since died leaving young children behind. I know they would have given anything in the world to be in my position, with only a few lines to worry about.
Yes, ageing is a BUMMER, but it's definitely better than not ageing.