To lock/unlock a Mac, you can do either of the following:
1. On an iMac, press "Control+Shift+Eject."
2. For MacBooks, press "Control+Shift+Power."
This generally gets a Mac working again when it gets stuck on screen saver.