Most of the mowers on dealer showrooms right now (April 2025) were made in 2024, along with a few 2023 and 2025. Some of those 2023's being received this year.
Manufacturers produce in large batches to reduce cost. Less organized manufacturers may have already shipped newer mowers and then the next shipment may be older. As long as the model # has not changed (with an updated design) then they consider them all the same.
Warranty starts the day it is retailed.
My main concern would be how it was stored. If it was in a dry warehouse, then I would have no concern at all.
As for a discount, if the dealer bought it 2 years ago then they probably paid less than current cost. They also may have had their money tied up paying some interest.
Typical dealer margins are high single digits to barely double digits. It's a tough business, made even tougher by customers buying at big box stores and then asking the local dealer to solve their problems.