Add update logic for DataCard.

If a row exists for a DataCard, attempt to update it first when
publish() is called. If the card cannot be updated, create a new row to
represent it.

Change-Id: I5fd250ca9a508735257b8fcd549570ae32b66982