I don't have experience with this yet, but being in my mid 30s now, I worry about it of course. But (again granting that I don't have your experience with this) what it looks like to me out there is that there seem to be fewer jobs that make sense for me at smaller more speculative companies, unless it's a CTO type role, but I see "senior" roles at large established companies that are more attractive anyway. (The problem is that I have to go study irrelevant undergrad algorithms in order to do the interviews, but that has been worth it for the jobs so far.)
Just keep learning and don't go stale and stay associated with tech that is going redundant. This is what I have always done and its done me well. I am 48 now and having a blast in my career hacking away on exciting projects.