You can use the TIMEDIFF()
function.
Example:
SELECT TIMEDIFF('2008-12-31 23:59:59.000001','2008-12-30 01:01:01.000002')
Source: link
I do not know what language you are using, but in PHP I would do so:
<?php
$con=mysqli_connect("exemplo.com","peter","abc123","my_db");
// Verifica conexão
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT id, TIMEDIFF(HrIni,HrFim) AS diferenca FROM Atendimento");
$row = mysqli_fetch_array($result);
$sim_nao = ($row["diferenca"] > 20) ? 'SIM' : 'NAO';
mysqli_query($con,"UPDATE Atendimento SET tempo='".$sim_nao."' WHERE id='" . $row['id'] ."'");
mysqli_close($con);
?>