Help with changing price after deduction…

This works successfully:

$wallet = $user->wallet;
$upwallet = ($sell_video == 0 && $wallet >= 1 ? 0.5 : 0);    
$db->rawQuery("UPDATE ".T_USERS." SET `wallet` = `wallet`- '".$upwallet."' WHERE `id` = '".$video->user_id."'");

(when the sell_video amount is 0 and the wallet amount >= 1, deduct 0.5 from the wallet). Works successfully.

I'd like guidance to add:
When the sell_video amount is 0 and the wallet amount = 0.5, change/update the sell_video to X.

I tried this, without any successful sell_video change:

if($sell_video === 0 && $wallet === 0.5) {
$sell_video = '1';
}

I'm guessing that 'sell_video' has to be updated in the db. Any example of what that might look like is appreciated.

Any assistance is welcomed.