UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SFOL4YIJmoh4u9D4hBaXY0KAey7Y7arSxZoo8obNMlA='
WHERE
key_id = '0c4fdfdf285b889fc155f35ff6b3abf3113ceb2d6b9834573f82ff1e38ddc64e'
AND (
token = 'SFOL4YIJmoh4u9D4hBaXY0KAey7Y7arSxZoo8obNMlA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)