UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I6Cj25rFuwEbIHnUH8kL3FyAeeP5JYiEyDRaJ5MRFcA='
WHERE
key_id = '6ce5356fb186c3a68bd5832ec81e6ab5917dafd8688a07f18d71ee009b78179d'
AND (
token = 'I6Cj25rFuwEbIHnUH8kL3FyAeeP5JYiEyDRaJ5MRFcA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)