This a problem. Consider two clients A, B:

* `A` wants to lock and get an `expire_at = 1000`. But `A` starts swapping out, and doesn't get to the SCRIPT part just yet. He will wake up eventually.
* `B` at the exact same time, wants to lock and get an `expire_at = 1000` as well. `B` successfully gets the lock, and is really really slow at doing its thing while holding the lock, to a point where his lock expires.
* `A` wakes up, sees that the lock has expired, and takes it.
* `B` doesn't know that his lock expired, and `unlock`. `unlock` will succeed, unlocking `A`'s lock. 

Use a global counter on redis to give unique leases to clients that they will use to unlock their locks.