UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sJulpdQ1xCHP4K1dGdP+1qU5y3JJ8AYHSwf5b1JEQiw='
WHERE
key_id = '0e6c192337ac316a0ec55fc87821bc9b71e3a04c575d7172e32bcb21b14a6dee'
AND (
token = 'sJulpdQ1xCHP4K1dGdP+1qU5y3JJ8AYHSwf5b1JEQiw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)