UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm8pZ5oqiETbTja/I+HjmUHR7nr5yWORXufA2immL/Ns='
WHERE
key_id = 'ce860300eb6e740340294b4ba2929d512b9b04803d79fdc123f47c459c0caee6'
AND (
token = 'm8pZ5oqiETbTja/I+HjmUHR7nr5yWORXufA2immL/Ns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)