This article describes how to access the emergency recovery UI and recover a Cloud Key. From this UI you can reset it to factory defaults, reboot, shutoff and upgrade the firmware. To upgrade the firmware you will need a firmware binary for the UniFi Cloud Key.
Source: UniFi – Cloud Key Emergency Recovery UI – Ubiquiti Networks Support and Help Center