Opening and closing solenoid deadbolt with key
The normal way is to not use a solenoid to operate the deadbolt but to open the striker plate on the other side. This is called an electric strike




That way you can use a conventional key operated bolt as a way to open the door when there is no electrical power.

You can buy these strikes for retrofitting to normal types of lock, both mortice locks and surface fitted locks.