There are two important factors: 1.) is this dead end career or rather it will be possible for you to find another job later? A lot of money now in exchange of having trouble to find another job later on is a bad deal. 2.) How does the shittiness affect you personal life? If it makes you constantly angry and lashing out at girlfriend/boyfriend, you risk losing her or at least damaging the relationship. Factor that in…
You neglect the scenario in which the overpaid employee could be married with dependents. When your kids depend on your paycheck, this is not such a simple matter, and making trades for "a lot of money now" doesn't seem like such a bad deal. When you're young and uncommitted, you can afford to make moves on airy idealism. You can't when you have something important riding on it. This is true even if you have a lot of…
However, none of my three was result of idealism. I think that I am older then the average here and I have kids. As I got older, those three became more important not less. Including and maybe especially after children. Children benefit from father that interacts with them happily and normally, if the dad is frustrated and angry from work it is harder. If you damage relationship with spouse while you have children, consequences are more painful to fix then as if you was twenty and just figuring out whether she is long term material or not.
I have seen people who became demotivated and complacent drones - and it did became real problem and it caught them up. It is harder to get rid of bad habits at later age. Ageism is also very real, so the older you are the more careful you have to be at how you look to prospect employers.
If you have small children you have less time to learn out of work and less free time to just relax. That makes the choice of work more important not less. You can not just slack around dead end technology in work and then use evening to learn new things as much as before (lets be honest, that is what many people without responsibilities at home do).