Update a value after an hour when a record is inserted I am doing a booking system for an iPhone app and I want to update the Status value to "Completed" after 1 hour.

I initially wanted to check for the TIMEDIFF of the current datetime and StartDateTime to get the remaining time, and update the value through the app once the timer is completed instead. But, I am not able to create the timer when the application terminates, so I need to create it in the database instead.

I'm not sure whether this is achievable, can anyone please help me?
First thing you should do: be self-critical with your original data model:

Why do you actually need to have a Status column in the table?

The status can be computed from the StartDateTime and EndDateTime. You just have one straightforward alternative: compute its value when needed. If (current_time &lt; start + 1 hour) and (end time is null) => we're in use, otherwise, it's completed. You can have this as a computed column in a VIEW. In MySQL you'd do:

CREATE VIEW job_log_with_status AS
SELECT
    ID, ResourceID, StaffID, StartDateTime, EndDateTime,
    TimeDiff(Coalesce(EndDateTime, now()), StartDateTime) AS TimeSpent,
    CASE 
        WHEN EndDateTime IS NOT NULL THEN 'Completed'
        WHEN TimeDiff(now(), StartDateTime) &gt; time '01:00:00' THEN 'Completed'
        ELSE 'In Use'
    END AS status
FROM
    job_log ;


(Assumption: your original table is called job_log)

When used, this view would output something similar to:

SELECT * FROM job_log_with_status;



ID | ResourceID | StaffID | StartDateTime       | EndDateTime         | TimeSpent | status   
-: | :--------- | :------ | :------------------ | :------------------ | :-------- | :--------
 1 | CM-01      | 175124N | 2017-07-13 18:41:53 | null                | 02:00:00  | Completed
 2 | CM-02      | 175124N | 2017-07-13 20:11:53 | null                | 00:30:00  | In Use   
 3 | CM-01      | 175124N | 2017-07-13 19:26:53 | 2017-07-13 20:26:53 | 01:00:00  | Completed
 4 | CM-02      | 175124N | 2017-07-13 19:56:53 | 2017-07-13 20:06:53 | 00:10:00  | Completed


You can check the setup and some sample data at dbfiddle here