They were both paid the going rate for keeping the QB, they are/were not overpaid.
Any team that cannot improve its QB situation pays what the market rate is for a franchise QB or they take a chance on a different one.
In my opinion, just a mid level QB makes a better team because with a lower level one, there is little chance. McMahon, Dilfer, Johnson, E. Manning and Flacco were mid level but they played well enough to win it all for their teams. What would have happened if those teams decided to take the risk to upgrade?
Also imo, almost every player in the NFL, and you can add MLB. NBA and NHL, is over paid but it is what it is. Is Aaron Rodgers worth 4X what Montana got paid? 2.5 what P. Manning got paid?
The money keeps growing but the sports are not improving.