UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IfxIGzBYeHY/GIzqaXUSDczEubC1AKBKpey3ez5Kt1E=' 
WHERE 
  key_id = '2f97b18c1007de12de3605ff235b3a68995f11297515493f435b4ea85bc6f3ce' 
  AND (
    token = 'IfxIGzBYeHY/GIzqaXUSDczEubC1AKBKpey3ez5Kt1E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033