UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Ntr0IdOxXzTtN/tseobUMgnAjkFJeorU8D+/2Su7+I='
WHERE
key_id = '1c9e101375ea957732fc610e33649bb489296d16d45715945ef137e511ddcf0f'
AND (
token = '8Ntr0IdOxXzTtN/tseobUMgnAjkFJeorU8D+/2Su7+I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)