I had a similar problem with my 300 SD Benz. I sprayed WD-40 into the lock and it worked for a little while. After that I had to get the whole ignition lock replaced. It wasnt cheap because the mechanic had to remove the steering collumn in order to get to the lock. After that the mechanic was permitted to obtain only one key. I had to bring my title and the stamped steel plate that you get with the car in order to get a second key from the dealership.
If your key has an electronic sensor on it I doubt that the WD 40 will affect it, however you might not want to risk not being able to start your car at all. But more than likely it has to be the ignition switch iteself.
