UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mf+snyfqgukpAGWief/sLB41JXXvwXB4D2ropt3Ghr8=' 
WHERE 
  key_id = '2ea3a6cb5f4ca0eb5ddb75c6e6765937751781b8c825bfd3badccc4c54edea7e' 
  AND (
    token = 'Mf+snyfqgukpAGWief/sLB41JXXvwXB4D2ropt3Ghr8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030