Unused key may well loose its charge over time, it can be charged on a toothbrush charger as said earlier. It may have lost its sync with the car so will need resyncing. Worth noting if you have more than 1 key they will need resyncing one after the other so they will both work. How to with three ways to do it here https://www.programyourkeys.com/BMW_Z4_Key_Remote_Control_Fob_Programming.html