Use Lua scripts for locking