UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9CXb/RX/uz/nCPs8x2GAdXDY+1zdYwMAOOccQ66jZGI=' 
WHERE 
  key_id = 'fc0d4cabb5bcfecc5a019cac3590952151e296e04c4618e6996f975dc85c2837' 
  AND (
    token = '9CXb/RX/uz/nCPs8x2GAdXDY+1zdYwMAOOccQ66jZGI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035