<?php 

if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user_set` WHERE `id_user` = '$user[id]' AND `ocenka` > '$time'"), 0) == 0) {
    mysql_query("UPDATE `user_set` SET `ocenka` = '" . (time() + 604800) . "' WHERE `id_user` = '$user[id]'");
}

else {
    mysql_query("UPDATE `user_set` SET `ocenka` = `ocenka` + '604800' WHERE `id_user` = '$user[id]'");
}