UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tQqc5KKvF19v9pe2ogXoNE4ThKXl7moLpZiPtaAOyr0='
WHERE
key_id = '53f18a1d7203c7699133239ab635310ce9cc6ac21d029d0cc5a726792f8eb93e'
AND (
token = 'tQqc5KKvF19v9pe2ogXoNE4ThKXl7moLpZiPtaAOyr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)