Yes, always make sure you're updating the BIOS of the motherboard behind a UPS. That way if your power gets cut, you still have ample amount of time to (hopefully) finish the BIOS updating while it is still in progress. I never update BIOS without using a UPS.
Can you fix a failed BIOS update if the power goes of with cmos or cmos battery?
I find it highly unlikely the CMOS battery will run out of power easily, they can last for a very long time. I have never heard yet of someone failing a BIOS update because his CMOS battery died while updating his BIOS. A dead cmos battery
can cause a PC not to turn on however, but again its not that you need to replace them very often.
Even if you "failed a BIOS Update", your board isn't totally doomed to oblivion. You can have it flashed with SPI Programming devices - there are two ways in which this is done
(1) - If your motherboard has a removable BIOS chip, you can remove it and buy another BIOS chip from ebay or online elsewhere and then attach it to your motherboard
(2) - For soldered BIOS chips, you use a "clip on" BIOS reprogrammer. This will still allow you to flash the BIOS even if it went bad. I have one myself.
This is basically how it's done in repair centers to service your motherboard with faulty BIOS. I do not condone the method for beginners, as you will need to understand what you're doing and have experience.