UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cYn5KcUfpqnFen+2notFMXFl99YR1BgiN71bNfEgdV0='
WHERE
key_id = '8180a09f0b38e9fb5c06b7e87eed5a3ac02fd0b50cc704a5edf5c7e3045aaf1f'
AND (
token = 'cYn5KcUfpqnFen+2notFMXFl99YR1BgiN71bNfEgdV0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)