UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j1Fo2ztGdK7+vy1LgXoQTlEyYsiQsTTY0AwDPuJHf4E='
WHERE
key_id = '836ef2e132fd9670cee1217f67e7d422bb12624d6622a7fd9cf784a0b76a45f3'
AND (
token = 'j1Fo2ztGdK7+vy1LgXoQTlEyYsiQsTTY0AwDPuJHf4E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)