Remotely lock or unlock a device