Don't mistake the length of a battery's warranty with how long a battery will 'last' - it's just a warranty, not a guarantee of performance.
So here's how it works: you buy a battery for $100 with a 60 month warranty. In 30 months, it dies.
You go back to where you purchased the battery, and you will pay $50 for a new battery - that's called a 'proration'.
The theory is that when you purchased the original battery (or original warranty) you were owed 60 months of starting. The battery only provided 30 months, so they owe you 30 months. That leaves extra 30-month on the new battery that you now need to pay for.
I can't speak for all battery brands, but I used to sell Excide, Motorcraft (Ford), and AC Delco.
Each battery had a month/year code as part of the labels. The month/year code would be used to calculate the proration (e.g. how much the, if any, the customer would pay for a new battery).
The obvious question here is: what if the battery was sitting on the shelf for 12-month, would that mean the customer loosed 12-months of warranty? No - each moth the battery vendors would swap-out the batteries in the store so that they were always 'fresh'
This sounds like a lot of work, but, going way back, if you bought a new battery, you would have to wait for it to be charged-up before you use it* - this way the batteries are good to right off the shelf.
*for the most part motorcycle batteries are still this way (you have to add the electrolyte and change them before used)