This should go for everyone, not just tech workers. We only get so many years on this planet, and assuming you make it to 35 and are reasonably healthy, you've likely got a lot more years ahead of you (another 40ish?).
You've had some education about life, work, money, etc. You've got no more excuses by 35. Have a plan. Have a backup plan. Understand what you'll need to do to execute on that plan.
For tech workers, this may be going in to consulting, doing a startup (two of the more popular ones), but it also may be moving around to different companies to keep tech skills cutting edge (or demanding that from current employers). Not everyone will be accommodating to your plan, but you have to execute. If current employers won't support you, find new employers.
There's probably many reasons people leave standard tech/dev work by that age - employers wanting cheaper/younger workers is the most popular reason/excuse, and there's probably some truth to that. But I moved out of that because much of it was boring. Some of the work was still interesting (data sizes, algorithms, etc) but the day to day realities of 'corporate life' grew tiresome. Never saying never - I won't rule out "corporate job" again - in fact, there's always some interesting companies popping up that need my skills/labor, and one day I may join one again. But my mindset is totally different about how I would approach a "job" again, and that mindset probably puts off many would-be employers anyway (making finding one both harder and easier at the same time).
So... what's your plan (those of you 35 or older)?