UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bIQ719MGIGV0IyyJyBp2Mao/2gmAm3PUYMm7W3PmQc8=' 
WHERE 
  key_id = '15eb268de8827d756c26ec8a90a91d8ffd8ea98315b4665dec11b72443a48708' 
  AND (
    token = 'bIQ719MGIGV0IyyJyBp2Mao/2gmAm3PUYMm7W3PmQc8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030