SKIP LOCKED
SKIP LOCKED is a locking-read option in MySQL 8.4 InnoDB that skips rows already locked by other transactions instead of waiting for them. When used with FOR UPDATE, it lets multiple outbox workers claim different available rows concurrently, reducing contention between workers.
Minimal example
START TRANSACTION;
SELECT id, topic, key_, payload
FROM outbox
WHERE sent_at IS NULL
ORDER BY id
LIMIT 10
FOR UPDATE SKIP LOCKED;
-- Process the selected rows.
UPDATE outbox SET sent_at = NOW(3) WHERE id IN (...);
COMMIT;