UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WsPsVkolIh+ScegEC9o+0YIjHk5SbgzuZhzEJBbI6BQ='
WHERE
key_id = '4758271d30222e46f285e089f7d1c4b03a323ee118144bf16cc729a85e5e9aea'
AND (
token = 'WsPsVkolIh+ScegEC9o+0YIjHk5SbgzuZhzEJBbI6BQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)