UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xH/MFqbUY503z9eqkp1NGYF9h/fMhBFUlHEqkpqLIFg='
WHERE
key_id = 'b497cfada4b7edef8668fd9e705f391842b352d42d0813c50a4ac77bc9bf4e8d'
AND (
token = 'xH/MFqbUY503z9eqkp1NGYF9h/fMhBFUlHEqkpqLIFg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)