UPSERT: SQL-UPDATE a row, or if not found INSERT a new row.
Inserting or updating a row has to deal with a possible race condition between concurrent operations.
Oracle, DB2, Teradata and MS SQL support the standard syntax for
MongoDB, MySQL, SQLite, Firebird support similar features.
UPSERT example for PostgreSQL in the manual or a detailed assessment in this blog article by @Depesz.