UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tMSPLMgX12Elqd0vX6B157fOOtGiib7vSwWUG64vVlc='
WHERE
key_id = '35322ca0b1e9cf01c9af4c1762f5d521254410b2e0ab6f092f6703a7547bb6be'
AND (
token = 'tMSPLMgX12Elqd0vX6B157fOOtGiib7vSwWUG64vVlc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)