This has never happened to me before - when leaving the computer idle for an hour, which is timelimit before comp. gets locked, the keyboard stops responding. Pressing the num- ocr caps lock buttons dont respond either. Mouse works tho. Only thing seems to be a reboot to solve this.
Are you using a keyboard with custom drivers, or one without custom drivers?
You can try going into Device Manager and unistalling the keyboard drivers. Usually Standard PS/2 keyboard is listed, might see another one if using keyboard with custom drivers. Uninstall both if there are 2.
Then restart the computer, and it will reinstall the standard keyboard driver. You will restart again after this is installed.
If there was a custom driver installed for keyboard, reinstall that as well.
Edit: Also check for BIOS updates for motherboard.