I'm going to go against the norm here. It's probably better to have them plugged in sometimes, if not always. Old capacitors can dry out and become brittle, which can destroy a mainboard when they surge and pop.
Nothing you do will be 100% guaranteed to keep electronics alive forever, because components wear out. Each console will have specific components with specific failure types that means that some are better having always power, some are better with sometimes power, and some are better with zero power. But my gut says that older consoles plugged into a quality UPS will probably last longer than a console sitting in a box unpowered.
https://en.wikipedia.org/wiki/Capacitor_plague
This is just one type of failure mode, but there are many other things that can cause damage. Power surges, transformer enamel wearing out, resistors cracking, thermal cycling of solder, thermal paste drying out, permanent CMOS batteries dying.... etc. etc. etc.