It's 2027. His total for that year would be $59.9 million. However, if they cut him before the third league day of 2027, they would not have to pay him his 2027 base salary ($10 million) or workout bonus ($550,000). That would be the cap savings, while his $49.4 million roster bonus would be sunk cost because it was guaranteed on the third league day of 2026.
Anything other than restructuring is pretty much impossible with this deal. They can't cut him before 2027 without incurring a major financial penalty. Even if they cut him by the third league day of 2026, his salary and workout bonus for that year would not be guaranteed, but they would only save $3 million in cap space (compared to the $38.9 million dead cap hit) since his base salary is $2.5 million.
This deal clearly shows the Chiefs are expecting him to be their starting QB that long, and expecting the cap to rise to the point where paying a QB $40 million per year is the going rate. The guarantees kicking in one to two years earlier and low base salaries until 2027 make that clear. 2027 really appears to be the only true out where the team would benefit. (Even in 2028, if he's on the roster the third day of 2027, his 2028 salary and roster bonus become fully guaranteed, so cutting him before the 2029 guarantee kicks in would only mean a savings of the $550,000 workout bonus in 2028.)
If the Chiefs have to move on from Mahomes before 2027, they are screwed.