iPhone/Mac: We've seen apps that unlock and lock your Mac from your iPhone before. Tether is not only one of the easiest to use tools out there, it's also free.
After you download and install the Mac app and iOS iPhone app, you'll pair together your phone and computer using Bluetooth. When you walk a certain distance away from your computer, Tether will automatically lock it. When you return, it will unlock. There are certainly other similar apps out there, but Tether was a little more reliable and easier to use for us.