UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5JtmbN4ZCNEU2a++rSUnH6/LpkTkCRp1rhybcnaLUts='
WHERE
key_id = '5825776fabf34f221fc0e60674cc9d139a0944261661086a9ebc116bd55944f5'
AND (
token = '5JtmbN4ZCNEU2a++rSUnH6/LpkTkCRp1rhybcnaLUts='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)