This is one of the moments when it helps to be a big budget team. He's about as likely as anyone in the league to give a steady 30 starts and 12-15 wins through his prime years, and that's probably enough for the Sox to live with the expense. There's also at least X% chance that he translates his ability into real #1 starter level, at which point it will actually be a good value down the line.
I have to think that the Sox calculate these things in terms of $$ per production. By limiting it to 4 years, they know there are no risky years at the end (e.g. the 5th-6th years of Lester's deal). And at the same time they are paying about 80% of the yearly rate for a top tier guy.
$80M for say 60 wins over 4 years (15-15-15-15)?
vs.
$155 for maybe 85 wins (17-16-15-14-12-11) if Lester slows down a little in a few years?
Numbers obviously not scientific, but that type of thinking ends up with $1.3M per win versus $1.8M per win, and a much bigger gap if Lester breaks down or Porcello makes the leap. (Obviously there's a chance of the opposite where Porcello regresses and Lester gets better with age, although I think it's much less likely).