By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE BuyOrder (
SharesLeft BIGINT UNSIGNED,
BuyOrderID INTEGER,
Transaction_coin_amount BIGINT UNSIGNED,
coinsLeft BIGINT UNSIGNED);
INSERT INTO BuyOrder (SharesLeft, BuyOrderID, transaction_coin_amount, coinsleft)
VALUES (100, 1, 100, 100);
UPDATE BuyOrder
SET CoinsLeft = CoinsLeft - transaction_coin_amount
WHERE BuyOrderId = 1 /* buy_order_id */;
Rows matched: 1 Changed: 1 Warnings: 0