UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'otNYR0CrXl692a87+9BFXWLP6Q+xDYjgphtUjMljgIk='
WHERE
key_id = 'e0fdb5b40b91d226af2a1a4c636a68afb84a199ea5efb04545301bdac08da8c6'
AND (
token = 'otNYR0CrXl692a87+9BFXWLP6Q+xDYjgphtUjMljgIk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)