Just because one player plays to an unusually high age, doesn't mean that other players aren't well into their decline before that age.
Jamie Moyer was a unique pitcher. He never threw hard enough to get batters out with a fastball, he relied on precise pitch placement, off speed pitches and changes of pitch velocity to fool batters. He didn't strike out very many batters but the changes in pitch velocity meant that when batters hit the ball they didn't get solid contact so he got enough ground balls and fly balls to get batters out and be modestly effective. He also typically did not pitch deep into the game and run up high pitch counts. his role was to get 6 solid innings and keep the game close enough for the offense and bullpen to do the rest.
Because he didn't throw hard, didn't throw as many pitches, and his arm lasted a lot longer. He also didn't decline as fast since his skill was never based on throwing hard. So losing a few MPH off his fastball as he aged didn't change his ability to get batters out because he had never relied on velocity to get outs in the first place.
And add the fact that he was left handed which is rarer so teams are more willing to keep him around longer because they have to take what they can get for left handed pitching.
Oh, and Moyer played for lousy teams for much of his career and was a fan favorite with the nice-guy image. So when you have lousy teams that will do anything to sell tickets and a fan favorite player who will play for a relatively low salary (and isn't terrible), there's a good chance the team will offer him contracts longer than what a contending team would offer to a declining player who is past his prime.