UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ceg4+FNLWyp57EV6S3oigja2FSBDYbdBIiVrPMA3XTA='
WHERE
key_id = '9645a9881ffc7cec136a22b345fc0cf6b7d456d76efad3c4a9abf1ce75603088'
AND (
token = 'Ceg4+FNLWyp57EV6S3oigja2FSBDYbdBIiVrPMA3XTA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)