Is there a way to set variable in UPDATE statement in PostgreSQL (plpgsql)? Something like this:

DECLARE
c INTEGER;
UPDATE table SET col = (c := col + 1) WHERE id = 1;


This is wrong:

ERROR:  syntax error at or near ":="


how to do it right?
Assuming the update only affects one row:

DECLARE
c INTEGER;
UPDATE table SET col = col + 1 WHERE id = 1
  RETURNING col INTO c;


Reference.