...no social program could pay for folks being retired for 30-40 years
Quite so! The inevitable consequence of even today's prolongation of age will be sufficient to break the bank in most nations.
What must needs come about is a restructuring of the "working" concept altogether - 's bout due, given that the current implicit model for many workers is Manchester style, 1850 version. Throw in some online teleworking methods and methodically slice certain kinds o jobs (investment banking, anyone?) into a few thousand discrete pieces from each - with one new ( but well worn) worker per subcomponent type of work, and ya'll have an actual sensible rationale and productive employment mechanism for employing older folks, in fractional jobs, until they're on the verge of solid dotty.
Result of a top-down redefinition of what comprises work and how it is to be done will not only create opportunity for the folks on the margins, but it will also magnify the real productive capacity of the society, and so doing will create additional wealth for the sharing.