I get the error: Column \'Time\' cannot be null when using the query below, it works fine the first time when there is no duplicate but then when trying to update again I get th
If there's no duplicate, then this query will do an insert, and the Time value will be null, as no value was ever set. Null + anything is null, hence the error.
Try ... Time = COALESCE(Time, 0) + INTERVAL $time SECOND or similar to get aroun dit.