Just lie what Ashish said you can use CRON , and if you want you maybe can use this , i did not use before , try it . This code will works once ,so you have to find away to make loop cause the time will change every sec . 
Note  : Check the second code .
<?php 
    // Database connect
    $date = date('H:i:s'); // Set the time to hours and minutes and seconds format  
    // you can echo $date to check how it looks but it will be something like this : 07:21:48
    if($date == "17:30:00") // 17:30:00 is equal to 5:30 but in 24 system 
    {
        // You can type your code here . 
    }
 ?>
Second Code :
<?php
 // Remember to connect to your database    
$date1 = date_create("00:00");
$date2 = date_create("23:59");
while($date1<=$date2)
{
    date_add($date1,date_interval_create_from_date_string("1 sec"));
    $a = date_format($date1,"H-i-s");
    if($a =='17:30:00')
    {
            $sql1 = "SELECT * FROM No where id='1'";
            $result1 = mysqli_query($mysqli,$sql1) or die(mysqli_error());
            $row= mysqli_fetch_assoc($result1)
                {
                    $Foo= $row['foo'];
                    $sql2 = "UPDATE No SET id='2',foo='$foo' where id='2'";
                    $result2 = mysqli_query($mysqli,$sql2) or die(mysqli_error());
                }
            die;
       }
    else
      {
         // you can type anything here , you can end the process by typing die; or anything you want 
      }
}
?>
You can check this and see how you can loop throw date in php : 
I have 2 dates in PHP, how can I run a foreach loop to go through all of those days?
This can help you understand the time and date system and how to change the format for the date in php : How to get the current date and time in PHP?