Use the SQL example here to efficiently update CartoDB tables. See both the INSERT and UPDATE variants