The exact same thing has happened to me this morning. Haven't used the car for 5-6 weeks but just kept battery topped up but when I tried to open key will not work despite changing battery in remote!
Thankfully a second key works so have accessed but nothing seems to work with first key despite all attempts to reprogram ( hold Lock, press unlock 5 times etc.) Haven't tried removing starter button and using metal key yet.
Car due for service at end of next month but dealer will ,as always, charge the earth for even a simple solution.