must be something to do with the key or the circular aerial around the ignition lock IMO if the CODE light is still on.
The aerial around the ignition lock reads the coded key (there is a small black pill like object that is in the key that the aeriel detects and allows the car to start, may be worth checking its there). Some people (on a 166 admittedly) have unplugged the wire for 30 secs and plugged it back in and it started to work again, otherwise its new aerial time, but cheaply available from a breaker.
If that doesn't work I'd be stumped beyond swapping body computers and lock sets etc etc as they are all coded to one car for security purposes, so it can get expensive if not the straightforward fixes.
What is unusual about your case is that it stopped while driving, this sort of think happens at start up.