UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D4V+j/BeluBoSbLrya4oJqITBmsFh1QbbP9y/CYXrsM=' 
WHERE 
  key_id = '574e62d4f19c176e61baf11b80ec40eb9af03693274c1061227a9c0084f99650' 
  AND (
    token = 'D4V+j/BeluBoSbLrya4oJqITBmsFh1QbbP9y/CYXrsM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033