UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F7LcJdzJtExoMn9OlXoY4ckjp3qK8o0XUJCKkywyr0U='
WHERE
key_id = 'd38c754649350cb88c4334299e6ad556ec2a6b2bf3d8c5cbe57e5dca8e9118b9'
AND (
token = 'F7LcJdzJtExoMn9OlXoY4ckjp3qK8o0XUJCKkywyr0U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)