Being in my 40s, too. Also started my career out as a really solid dev working for the top companies in the business in the 90s (probably one of the best).
I found my dream job again, after getting stuck somewhere after the former company I worked for was acquired by big NY finance.
I was fairly lucky, because I was still pretty relevant, on my game, studied all that college alg stuff again, and I even was flown out to FAANG companies for interviews, etc.,
But I still interviewed at 40 places to get a single offer.
Tech also changes so much, that someone with 10 years of the wrong experience (legacy tech), is less important than 2 years of the vNext tech-stack.
You need to really a) lock in what people are doing for technical coding tests these days, sure it's gate-keeping, but it is what it is b) make sure you've gotten some coaching on how to answer a lot of the soft-skill questions (you know, the fluffy stuff that devs typically think don't matter, but that are used to build an impression of you speaking....lots of websites out there.). And you'll need to change your mindset a bit, likely, into thinking like your younger-self, and not like hey, I'm 20+ years experience, etc. Pretend like you have 5 years experience, and go for it.