So, I am trying to update the status_modified_time only if the status has changed, else keep it the same.
UPDATE table SET status = <new_status>,
status_modified_time = IF(status = <new_status>, status_modified_time, now()) WHERE id = <id>
this query makes status_modified_time = status_modified_time
UPDATE table SET status = <new_status>,
status_modified_time = IF(status = <old_status>, status_modified_time, now()) WHERE id = <id>
this query makes status_modified_time = now() is it that mysql is updating the status field first and then checking the condition??