http://www.knocktounlock.com/ comes to mind.
Edit: Sorry, it appears Knock can't actually lock your Mac. Airlock promises that functionality though - so that might be of interest to you.
Edit: Sorry, it appears Knock can't actually lock your Mac. Airlock promises that functionality though - so that might be of interest to you.