Locking/transactions in MySQL Stored Procedure
Do these with autocommit=1, with PRIMARY KEY(request_hash):

DELETE FROM openduty_dedup
    WHERE triggered &lt; NOW() - INTERVAL 10 SECOND
      AND request_hash = $hash;
INSERT IGNORE INTO openduty_dedup
    (request_hash, triggered)
    VALUES ($new_hash, NOW());


If the INSERT fails, either there is an entry in the last 10 seconds, or someone else snuck in just now.  If you need to know about success, check Rows_affected(), which is connection-specific and does not need to be in a transaction.

No need for START TRANSACTION.  No need to pre-compute "now".  No need for GET_LOCK().  The only flaw is the hard-coded 10 second window.