The first thing to note is those two extra years are "free". So the customer will not miss out on anything in years 4 and 5.
Personally, I would replace the MX400 now.
Another option you could consider is using subscription licence instead of co-term licencing. This allows you to use the same licence on a new box in the same family. I'm starting to lean into subscription licenceing for larger customers because it makes doing hardware upgrades like this SO much easier.
https://documentation.meraki.com/General_Administration/Licensing/Meraki_MX_Subscription_Licensing
For example, if you licence an MX400 under a subscription licence, you could then swap out the MX400 for any of these devices with no impact:
- MX90-HW
- MX95-HW
- MX100-HW
- MX105-HW
- MX400-HW
- VMX100
- vMX-L