if(!empty($row['mess'])){
<form method="POST">
<a class="nav-link"><button type="button" name="yved" value="submit" class="btn btn-link" id="liveToastBtn"><i class="fas fa-bell"></i></button>
...
<button type="submit" name="yved" value="submit" class="btn-close" data-bs-dismiss="toast" aria-label="Закрыть"></button>
</div>
<div class="toast-body">
<?php echo'<span style="color: #008000;"><b> '.$row["mess"].'</span>'; } ?>
<?php
if(isset($_POST['yved']))
{
$query = mysqli_query($dblink, "UPDATE `za` SET `mess`='', WHERE `id` ='".$_SESSION['user_id']."'") or die(mysqli_error());
if(mysqli_query($dblink, $query))
{
echo '';
}}?>