It would appear that MySQL has native support for this, albeit in a non-standard way. I know that Oracle does as well through the
MERGE statement. A more standard-respecting way to do it would be to try the update first and then, if the update returns no rows, try the insert, ie.
my $rowcount = $update_stm->execute(@args);
if ($rowcount == 0) {
$insert_stm->execute(@other_args);
}