Reset the BIOS to factory defaults first.
Then check to see if the same problem occurs when running in Safe mode.
If no, then that could point to a problem with software that runs in 'normal' mode but not Safe mode.
If yes, it could be a hardware problem.
To find out, boot from a
Live CD|USB such as
Knoppix and see if the same problem occurs.
If yes, and if possible, try plugging the keyboard into a different port ... one that's directly connected to the motherboard (of course).
If the same problem is
still occurring, starting to sound like it may be a bad motherboard.
Let us know what you find ...