UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JEsfFJG+YMcrY6ipg4JCqpAxKcX6Yjw2ASnLU7EylaQ='
WHERE
key_id = '1d26fe7e553b263ce439679b1de9cb37b13c910914b13651f6a60c07d1c1507a'
AND (
token = 'JEsfFJG+YMcrY6ipg4JCqpAxKcX6Yjw2ASnLU7EylaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)