Command and Option keys not working on one keyboard (not hardware)
I opened "Keyboard Preferences" and clicked on the Modifier keys. Clicked on "Restore to defaults". And the modified keys started working again. After that I switched the modifier keys back to my preferred set. And things are still working. Feel quite good. It saved me an avoidable reboot.

I am in such a similar issue often. The problem used to get fixed after restart (probably will also work, after logout/login -- did not check). Today it happened again. I tried the defaults method above and it worked.