UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8gFdJ02f1liJbKCUoXsoo9/2U2VhmI5A9pHKeVXmxws='
WHERE
key_id = 'd44975ac29ba5eca1a05c0ba5aa41e8fb122f8b8d15b4bdd9e11247986006c2f'
AND (
token = '8gFdJ02f1liJbKCUoXsoo9/2U2VhmI5A9pHKeVXmxws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)