I have had this happen to me a couple times and I have made a couple posts about it. Here goes again
ok so there is a security system built into the keys them selfs. What happens is that if you accidentally push the lock or unlock button a certain number of times, I think it between 5 and 10, the unlock stops working and same applies for the lock button. The reason behind this, if you happen to lose you car keys someone can't just walk around and hit the unlock lock buttons over and over to find your car. Both times this happened to me I had my cell phone in the same pocket as my keys and I assume that the phone must have accidentally hit the buttons.
Ok so to reset the keys, you don't need to go to the dealer, you don't need a new battery (normally what the dealer tells you). What you can do is 1 disassemble the key and remove the battery for a couple seconds and the put the same battery back and put the key backtogeather (this can be hard because the keys are a pain in the arse to get appart search for how to do this there is a diy somewhere out there) or 2 try the re sync procedure now I have never done this because I just dissasemble the key clean it and reasemble the key and it is reset and working fine. A n y ways to re sync the key I am pretty sure the procedure goes like this. Unlock your car with the key, and start the engine with in one minute this should re sync the key from what I have read. Hope this helps.