UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6KdV3eziWnfGw5gamkl4eLT1o7wx+4xxo6jmAgRnzYo=' 
WHERE 
  key_id = '3fd6915195b8c5bc91f3d360fa5ae87462fd3ff17f38f24616ac7e5246aac31d' 
  AND (
    token = '6KdV3eziWnfGw5gamkl4eLT1o7wx+4xxo6jmAgRnzYo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020