UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'skQ+pnnSJCzfLL2auSv0b8seujuMGxkIGKEmyUcUsBI='
WHERE
key_id = 'ceca09f01fc5bb6f54941ffed39dc6682458ad398ad0d35ff0310b0024962f92'
AND (
token = 'skQ+pnnSJCzfLL2auSv0b8seujuMGxkIGKEmyUcUsBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)