UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UMBlEo82RdVnYMwE/MCNjpnpgCxUadbMKBl94cTTSrU='
WHERE
key_id = 'f0534649fe54fa1f0b7c139893ab9ebc0846f52e2c79bd22e14cd43ecad2ae11'
AND (
token = 'UMBlEo82RdVnYMwE/MCNjpnpgCxUadbMKBl94cTTSrU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)