At least in America if you don't move into management you're dead meat by 40, 50 tops (unless you're some sort of genetic freak). Around that time it becomes impossible to put in the 50+ hour work weeks at a moments notice ... It's not even age discrimination. They don't care that you're old, they care that you either can't or won't put in tons of overtime they don't pay you for.
Genetic freak checking in. I'm 52, still a senior systems programmer/administrator and can still work 36 hours straight when needed - though I seriously try to keep those sessions from being needed. I've been asked many times if I want to move into management, but always decline as I'd rather shoot myself in the head than attend meetings, do budgets and write reports, etc... So far, I've also managed to avoid daily scrum and other process meetings (which are a complete waste of time, or my time anyway, btw).
Sure they can fire me, but I'm debt free and financially independent (even w/o a job) for, basically, the rest of my life, so they have little leverage over me... I work because my teammates depend on me to help get things done.