INSERT and UPDATE
statements using the IF clause, support lightweight transactions, also known as
Compare and Set (CAS).
Register a new user.
INSERT INTO users (login, email, name, login_count)
VALUES ('jdoe', 'email@example.com', 'Jane Doe', 1)
IF NOT EXISTS
Perform a CAS operation against a row that does exist by adding the predicate
for the operation at the end of the query. For example, reset Jane Doe's
SET email = ‘firstname.lastname@example.org’
WHERE login = 'jdoe'
IF email = ‘email@example.com’