UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8vZdl6yd6uotn88kf462EnSlvwyJWYh1UDgFnvZgo48='
WHERE
key_id = '721fc417219ad76d54cef3b338c2e5c8a63b5110cce022b9f963342291779cb8'
AND (
token = '8vZdl6yd6uotn88kf462EnSlvwyJWYh1UDgFnvZgo48='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)