At 58, I feel lost

Well, I spent over 30 years in the corporate world. My boss, in his early forties, thinks I'm useless because of my age. I do a lot of work, including writing scripts in SQL (and other scripting languages) and taking on complex projects. But that's not good enough. I tried to change my career but could not get past the first round--could not hide my age in person. I took and passed a professional exam to change my job, but I was naive to think that passing a certification exam would get me to the mountaintop.

I still have almost 10 years before I reach my full retirement age. I want to change my career but don't know where to go or what to do. I feel so lost. I had some success in my career, but I don't dwell on it. I just need to make it to the finish line--I cannot retire just yet financially.

I just had to rant. Is anyone in a similar situation?

Edit:

I am just overwhelmed with the support I'm receiving here. Thank you all. I will get through this, and this too shall pass.