SELECT col1 FROM table WHERE condition; if (col1 exists) { UPDATE table SET col2 = }