Select UNIQUE return
Select the MAX(time) grouping by vid and find the corresponding Id.

select t1.id, t1.vid, t1.data, t1.time
from yourTable t1
     join (select vid, max(time) as time
           from yourTable
           group by vid) t2
     on t1.vid = t2.vid
     and t1.time = t2.time;


If you need WHERE or ORDER BY:

select t1.id, t1.vid, t1.data, t1.time
from yourTable t1
     join (select vid, max(time) as time
           from yourTable
           group by vid) t2
     on t1.vid = t2.vid
     and t1.time = t2.time
WHERE t1.SOME_FIELD = SOME_VALUE
ORDER BY t1.SOME_FIELD;