UPDATE `book` SET `buy` = `amount` WHERE `buy` > `amount` AND SET `price` = 0.9 * `price` WHERE `buy` = 0;
UPDATE `book` SET `buy` = `amount` WHERE `buy` > `amount`
UPDATE `book` SET `buy` = if(`buy` <= `amount`, `buy`, `amount`), `price` = if(`buy` = 0, `price` * 0.9, `price`);