Implementation of the locking mechanism described in the Redis SET command documentation