UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'crujgubQrNDVS+pXW5ffRi/4bw9JwQK6cnD06Bq5w7E='
WHERE
key_id = '6634c8a57328f3f86a68e9072a1fdea54d1ee13971e6eb8be7daa409f3727ecf'
AND (
token = 'crujgubQrNDVS+pXW5ffRi/4bw9JwQK6cnD06Bq5w7E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)