If you keep spare UPS batteries on the shelf, make sure you rotate them into your running UPS unit every month or so to keep them fresh and charged.
I am mostly speaking of data center level user replaceable UPS batteries like a APC Symmetra or similar. Keeping spare batteries is a good idea for replacement of a failed battery and for extra runtime when the lights do go out. In the case of extra runtime needed, you can keep extra batteries on the shelf and swap them in if your runtime gets low due to a power outage and you don't have a generator on standby. Just make sure you rotate them into the unit every month or so. The approximate shelf life of a Symmetra battery is 6 months. After that, they are considered dead or at least reduced efficiency.
Another UPS battery tip is to date stamp the battery when you buy it. This will help control the shelf life as well as overall life as the life expectancy of one of these is usually about 2 years.