Bonuses are excluded from the distribution calculation. So after you separate the $10m bonus, you only have to distribute the other $25m as salary.
Rather than just doing an even 5-5-5-5-5 distribution, think about if it makes sense to either front-load or back-load the contract with an uneven distribution. With $25m over 5 years, you can do something like (2.5 - 3.75 - 6.25 - 6.25 - 6.25), or put those five numbers in any order, based on what you current year and future years salary caps look like.
I see too many owners doing straight-even distributions, which may not always be the best move. Don't be afraid to think outside the box a little.