Same thing happened to me. I got mine replaced at the dealer, was going to go for the key delete, but I've had experiences in Manhattan for some reason or another that the key fob doesn't work and had to use the physical key to get in. I've talked to a few tow truck drivers and said there is something broadcasting around the city that interferes with the radio waves for some remote fobs on cars. It's probably for jamming any remote devices that may set off bombs or something. Not sure if your area is affected but if not, go for the delete.
2003 Cobra -> 2010 BMW e90 M3 - Space Grey - Black on Carbon Leather Int. - BRILLIANT CAR!!