UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SGMbCfD1EjLBj20co2ZQLmOixq8jkk6HFXbXiLXf6CY='
WHERE
key_id = '1142f419b7e5873c3191e4fc3ae8e3e1e3e6438800c399c013c3c5a4a9189d1b'
AND (
token = 'SGMbCfD1EjLBj20co2ZQLmOixq8jkk6HFXbXiLXf6CY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)