What maintenance should be done on a bike pump to keep it in good condition?
As @DanielRHicks indicated in a comment, as far as preventing rust, you can disassemble a mini pump to let the internals dry out. This video shows how to disassemble a Lezyne mini pump. I am not 100% certain, but I think the Lezyne pumps may not have any steel parts, which should reduce the likelihood of rust.
Answering the question more broadly, rubber o-rings are commonly used inside pumps to form airtight seals, e.g. between the piston and the walls of the pump. Rubber compounds will degrade with time due to oxidization. You can't stop this process any more than you can stop entropy itself (although I have a Lezyne mini that's over 10 years old, and it's still airtight, so it might take a while). However, if Lezyne still offers spare parts when this happens to you, you can buy a replacement o-ring kit, e.g. here, and then replace the o-rings. Dirt may also get inside the pump internals, and as the video shows, you can simply wipe off and regrease the internals. I'm not extremely familiar with grease types, but silicone grease as Daniel recommended is used for metal to non-metallic components (whereas lithium grease is for metal-metal interfaces), so this would be the type to use.
Lezyne does offer spare gauges, chucks or heads (the part you plug onto the valve), and hoses for both their mini and floor pumps. To my personal knowledge, Silca also makes a big point of offering spare parts for its pumps (which are premium items, so one would hope that they did). I would assume that most major manufacturers, like Zefal, should offer similar spare parts.