UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P6SCdURXduo6j/oLmqCIlJoBvAZ7npFHSmKM7z8BHRA='
WHERE
key_id = 'ac9c24feed5a43f39847b3ea010f637f14d2ac6af78af057f0f641c5d3ff8b8b'
AND (
token = 'P6SCdURXduo6j/oLmqCIlJoBvAZ7npFHSmKM7z8BHRA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)