select _id, time,to_timestamp((json->>'received')::int8/1000) as received from eg5120 where to_timestamp((json->>'received')::int8/1000) - time > interval '1 second';

begin;

update eg5120 set time=to_timestamp((json->>'received')::int8/1000) where _id in ( select _id from eg5120 where to_timestamp((json->>'received')::int8/1000) - time > interval '1 second' );
